package cc.new3ol.vue.rest;

import java.util.concurrent.TimeUnit;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
public class DataRest {

	@GetMapping("time")
	public String time() {

		long currentTimeMillis = System.currentTimeMillis();// 秒
		// 毫秒转微秒
		long MICROSECONDS = TimeUnit.MICROSECONDS.convert(currentTimeMillis, TimeUnit.MILLISECONDS);

		log.info("毫秒	{} ", currentTimeMillis);
		log.info("毫秒转微秒	{} ", MICROSECONDS);

		return "当前毫秒" + MICROSECONDS;
	}

	@GetMapping("json")
	public String json() {

		String json = "[{\"id\":\"0\",\"name\":\"首页\"},{\"id\":\"11\",\"name\":\"控制台\",\"asides\":[{\"id\":\"11\",\"name\":\"home\",\"path\":\"/\"},{\"id\":\"22\",\"name\":\"choice\",\"path\":\"/choice\"},{\"id\":\"33\",\"name\":\"NorthCapital\",\"path\":\"/NorthCapital\"},{\"id\":\"44\",\"name\":\"NetInflowTop\",\"path\":\"/NetInflowTop\"}]},{\"id\":\"22\",\"name\":\"应用市场\",\"asides\":[{\"id\":\"111\",\"name\":\"小米市场\",\"path\":\"/\"},{\"id\":\"222\",\"name\":\"苹果市场\",\"path\":\"/choice\"}]}]";

		return json;
	}

}
